<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no">
    <title>去保养-有人情味的保养</title>
    <meta name="keywords" content="去保养,汽车保养,汽车配件,汽车维修,养车,4S店品质,氦修驿站" />
    <meta name="description" content="上门取车保养、保养在线观看、咖啡馆里做保养、夜间保养" />
    <link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/css/base.css">
    <link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/mobile/css/master.css">
    <link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/mobile/css/yuyue.css">
    <link rel="stylesheet" type="text/css" href="{:C('WEB_URL')}Public/mobile/css/calendar.css">
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?11ad56ca0738ac14d150a362fca3e058";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>


</head>
<body>
    <header class="tcenter fs14">
        <a href="tel:4006730088" class="tel iconfont">&#xe610;</a>
        <a href="{:C('WEB_URL')}mobile/" class="iconfont fright">&#xe60f;</a>
        <a href="javascript:window.history.go(-1)" class="iconfont fleft">&#xe612;</a>
        选择车型
    </header>
    
    <div class="step">
        <eq name="_SESSION['location']" value="3301">
            <ul class="hz">
                <li class="over"><span>1</span>选择车型</li>
                <li class="current"><span>2</span>填写信息</li>
                <li><span>3</span>订单完成</li>
            </ul>
        <else />
            <ul>
                <li class="over"><span>1</span>选择车型</li>
                <li class="current"><span>2</span>填写信息</li>
                <li><span>3</span>选择店铺</li>
                <li><span>4</span>订单完成</li>
            </ul>
        </eq>
    </div>
    <div class="carInfo" style="background:#f5f5f5">
        <p>{$auto['brand_name']} {$auto['model_name']} {$auto['model_pl']} {$auto['model_year']}  <a href="{:U('step1')}?choose=true&back=home">更换 &gt;</a></p>
        <span id="J_valueJY" class="hide">{$auto['capacity']}</span>
    </div>

    <form action="{:U('step3')}" method="get" id="J_myForm">
         <div class="serviceTime">
            <h3><i>&#xe629;</i>选择预约服务时间</h3>
            <div id="yuyue">
                <h4><i id="J_calendar">&#xe628;</i>预约时间：<em>--:--</em></h4>
                <div class="dayList">
                    <i class="J_next">&#xe603;</i>
                    <span id="J_today"></span>
                    <p class="J_dayList"></p>
                </div>
                <div class="dataList">
                    <div>
                        <span><i>&#xe61c;</i>09:00<br /><i>&#xe61c;</i>11:00</span>
                        <p>
                            <em data-class="1_1"></em><em data-class="2_1"></em><em data-class="3_1"></em><em data-class="4_1"></em><em data-class="5_1"></em>
                        </p>
                    </div>
                    <div>
                        <span><i>&#xe61c;</i>11:00<br /><i>&#xe61c;</i>13:00</span>
                        <p>
                            <em data-class="1_2"></em><em data-class="2_2"></em><em data-class="3_2"></em><em data-class="4_2"></em><em data-class="5_2"></em>
                        </p>
                    </div>
                    <div class="l">下  午</div>
                    <div>
                        <span><i>&#xe61c;</i>13:00<br /><i>&#xe61c;</i>15:00</span>
                        <p>
                            <em data-class="1_3"></em><em data-class="2_3"></em><em data-class="3_3"></em><em data-class="4_3"></em><em data-class="5_3"></em>
                        </p>
                    </div>
                    <div>
                        <span><i>&#xe61c;</i>15:00<br /><i>&#xe61c;</i>17:00</span>
                        <p>
                            <em data-class="1_4"></em><em data-class="2_4"></em><em data-class="3_4"></em><em data-class="4_4"></em><em data-class="5_4"></em>
                        </p>
                    </div>
                    <div class="l">晚  上</div>
                    <div>
                        <span><i>&#xe61c;</i>17:00<br /><i>&#xe61c;</i>19:00</span>
                        <p>
                            <em data-class="1_5"></em><em data-class="2_5"></em><em data-class="3_5"></em><em data-class="4_5"></em><em data-class="5_5"></em>
                        </p>
                    </div>
                    <div>
                        <span><i>&#xe61c;</i>19:00<br /><i>&#xe61c;</i>21:00</span>
                        <p>
                            <em data-class="1_6"></em><em data-class="2_6"></em><em data-class="3_6"></em><em data-class="4_6"></em><em data-class="5_6"></em>
                        </p>
                    </div>
                </div>
            </div>
        </div>
        <p class="line pt10">&nbsp;</p>
        <div class="userData">
            <h3><i>&#xe614;</i>您的信息</h3>
            <ul>
                <li><input type="text" name="realname" value="{$_SESSION['order']['realname']}" placeholder="您的姓名"></li>
                <li><input type="tel" name="phone" value="{$_SESSION['order']['phone']}"  placeholder="您的手机号"></li>
            </ul>
        </div>
        <p class="line pt10">&nbsp;</p>
        
        <div class="company">
            <h3><i>&#xe626;</i>选择的维修厂</h3>
            <img src="{:C('WEB_URL')}{$company['headImage']}">
            <p class="name">{$company['wx_name']}</p>
            <p class="fs14 fc-999">{$company['wx_address']}</p>
        </div>
        <p class="line pt10"></p>
       
        <style>
            .goodsList{ position:relative;padding:15px;margin-top:10px;}
            .goodsList h3 i{ border:2px solid #fff; position:absolute;top:-20px;left:10px;background:#0093D0;width:32px;height:32px;border-radius: 20px;color:#fff;text-align:center;line-height:32px;font-size:20px;}
            .goodsList h3{ font-size:15px;padding-left:40px;margin-top:-20px;padding-bottom:10px;}
            .goodsList li{ border-bottom:1px dashed #ddd;padding:5px 0;}
            .goodsList li img{ margin-left:0px;}
        </style>
        <div class="goodsList">
            <h3><i>&#xe623;</i>您的配件</h3>

            <ul class="clearfix">
                <li>
                    <img src="http://app2.haixiuyizhan.com/{$jyF['logo']}" alt="">
                    <p class="name">{$jyF['pj_name']}&nbsp;{$jyF['weight']}L*{$jyF['count']}</p>
                    <p class="price">￥{$jyF['pj_csprice']*$jyF['count']} <span>￥{$jyF['pj_scprice']*$jyF['count']}</span></p>
                </li>
                <li>
                    <img src="http://app2.haixiuyizhan.com/{$jv['logo']}" alt="">
                    <p class="name">{$jv['pj_pinpai']}&nbsp;{$jv['pj_xinghao']}</p>
                    <p class="price">￥{$jv['pj_csprice']}<span>￥{$jv['pj_scprice']}</span></p>
                </li>
                <notempty name="jyO">
                    <li>
                        <img src="http://app2.haixiuyizhan.com/{$jyO['logo']}" alt="">
                        <p class="name">{$jyO['pj_name']}&nbsp;{$jyO['weight']}L*{$jyO['count']}</p>
                        <p class="price">￥{$jyO['pj_csprice']*$jyO['count']}<span>￥{$jyO['pj_scprice']*$jyO['count']}</span></p>
                    </li>
                </notempty>
                <li>
                    <img src="{:C('WEB_URL')}Public/mobile/images/server.png" alt="">
                    <p class="name">小保养服务费</p>
                    <p style="color:#999">包含：洗车、138项安全检测、咖啡</p>
                    <p class="price">￥150</p>
                </li>
            </ul>
        </div>
        <p class="line pt10">&nbsp;</p>

        <p style="height:55px;background:#F4F4F4"></p>
        <div class="pay">
            <p class="needPay" <neq name="already" value="2">style="bottom:8px;"</neq> ><span>总价：</span><em id="J_payPrice">￥{$_SESSION['order']['totalPrice']}</em></p>
            <p class="couponTxt"></p>
            <a href="javascript:void(0)" id="J_btnGoPay">立即预约</a>
        </div>
        
    </form>

    <div id="calendar">
        <div class="calendar clearfix">
            <p class="nowDate">
                <a href="javascript:void(0)" class="prevMonth">&lt;</a>
                <span></span>
                <a href="javascript:void(0)" class="nextMonth">&gt;</a>
            </p>
            <p class="week">
                <span class="sun">日</span><span>一</span><span>二</span><span>三</span><span>四</span><span>五</span><span class="sun">六</span>
            </p>
            <div class="yearList">
                <ul></ul>
                <p><a href="javascript:void(0)" class="prev">←</a><a href="javascript:void(0)" class="next">→</a><a href="javascript:void(0)" class="close">×</a></p>
            </div>
            <ul class="monthList">
                <li data-value="0">一月</li><li data-value="1">二月</li><li data-value="2">三月</li>
                <li data-value="3">四月</li><li data-value="4">五月</li><li data-value="5">六月</li>
                <li data-value="6">七月</li><li data-value="7">八月</li><li data-value="8">九月</li>
                <li data-value="9">十月</li><li data-value="10">十一月</li><li data-value="11">十二月</li>
            </ul>
            <ul class="days"></ul>
        </div>
        <div class="bg"></div>
    </div>
    
    <div id="loading">
        <p>努力加载中...</p>
    </div>

    <input type="hidden" id="J_already" value="{$already}" />
    <input type="hidden" id="J_total" value="{$_SESSION['order']['totalPrice']}" />
    <input type="hidden" id="J_priceJY" value="{$_SESSION['order']['priceJY']}" />

    <include file="Public/mobileHome" />
    <script type="text/javascript" src="{:C('WEB_URL')}Public/mobile/js/chooseGoods.js"></script>
    <script type="text/javascript" src="{:C('WEB_URL')}Public/mobile/js/dateTime.js"></script>
    <script type="text/javascript" src="{:C('WEB_URL')}Public/mobile/js/actCalendar.js"></script>
    <script>
        chooseGoods.couponStatus="{$already['status']}";
        chooseGoods.couponMoney="{$already['rand_money']}";

    	var server = "{$Server}";

        $(function(){
            $("#J_btnGoPay").on("click",function(){


                var coupon=$("#J_couponList").find(".current"),
                    userDom=$(".userData"),
                    _t=$(this),
                    data={};

                var yy_date=$("#yuyue").find(".J_dayList > .current").attr("data-t");   //预约日期
                var yy_time=$("#yuyue").find(".dataList").find(".my").attr("data-class");
                if(yy_date==""||yy_time==undefined){
                    showMsgTip("请选择需要预约的时间");
                    return false;
                }
                data['yy_date']=yy_date;
                data['yy_time']=yy_time.split("_")[1];

                if(typeof coupon[0]!="undefined"){
                    data['coupon']=coupon.attr("id").replace(/\D/g,"");
                }
                
                data['phone']=userDom.find("input[name='phone']").val();
                data['realname']=userDom.find("input[name='realname']").val();

                data['source']=4;

                if(data['realname']==""){
                    showMsgTip("请输入您的姓名");
                    return false;
                }else if(!/^(13|15|18|14|17)[0-9]{9}$/.test(data['phone'])){
                    showMsgTip("请输入正确的手机号");
                    return false;
                }

                $("#loading").show();

                $.ajax({
                    type:"post",
                    url:"{:C('WEB_URL')}mobile/createOrder",
                    data:data,
                    dataType:"json",
                    success:function(res){
                        window.location.href="{:U('step4')}?type=yuyue";
                    }
                })

            })

            $("#J_useCoupon").on("click",function(){
                var code=$("#J_couponCode").val();
                if(!/\d{16}/.test(code)){
                    showMsgTip("请输入正确的优惠码",2000);
                    return false;
                }

                if(typeof $("#J_coupon"+code)[0]!="undefined"){
                    showMsgTip("该优惠券已添加",2000);
                    return false;
                }

                $.ajax({
                    url:"{:C('WEB_URL')}mobile/valCoupon/",
                    type:"post",
                    data:{"code":code},
                    dataType:"json",
                    success:function(res){
                        if(res.status==1){
                            printCoupon(res.data);
                        }else{
                            showMsgTip(res.info,2000);
                            return false;
                        }
                    }
                })
            })
        })

        
        function printCoupon(data){
            var html='<li onclick="chooseGoods.chooseCoupon(this)" data-type="'+data['type']+'" data-val="'+data['money']+'" data-low="'+data['low_money']+'">'+
                        '<i>&#xe60a;</i>'+
                        '<em>-￥'+data['money']+'</em>'+
                        '<p class="name"><span>'+data['content']+'</span></p>'+
                    '</li>';

                $("#J_couponList").append(html);

            $("#J_couponList").find("li:last").click();
            $("#J_couponCode").val("");
        }

        
    </script>
</body>
</html>